///#source 1 1 /Common/jquery.xdomainrequest.min.js /*! * jQuery-ajaxTransport-XDomainRequest - v1.0.3 - 2014-06-06 * https://github.com/MoonScript/jQuery-ajaxTransport-XDomainRequest * Copyright (c) 2014 Jason Moon (@JSONMOON) * Licensed MIT (/blob/master/LICENSE.txt) */ (function(a){if(typeof define==='function'&&define.amd){define(['jquery'],a)}else if(typeof exports==='object'){module.exports=a(require('jquery'))}else{a(jQuery)}}(function($){if($.support.cors||!$.ajaxTransport||!window.XDomainRequest){return}var n=/^https?:\/\//i;var o=/^get|post$/i;var p=new RegExp('^'+location.protocol,'i');$.ajaxTransport('* text html xml json',function(j,k,l){if(!j.crossDomain||!j.async||!o.test(j.type)||!n.test(j.url)||!p.test(j.url)){return}var m=null;return{send:function(f,g){var h='';var i=(k.dataType||'').toLowerCase();m=new XDomainRequest();if(/^\d+$/.test(k.timeout)){m.timeout=k.timeout}m.ontimeout=function(){g(500,'timeout')};m.onload=function(){var a='Content-Length: '+m.responseText.length+'\r\nContent-Type: '+m.contentType;var b={code:200,message:'success'};var c={text:m.responseText};try{if(i==='html'||/text\/html/i.test(m.contentType)){c.html=m.responseText}else if(i==='json'||(i!=='text'&&/\/json/i.test(m.contentType))){try{c.json=$.parseJSON(m.responseText)}catch(e){b.code=500;b.message='parseerror'}}else if(i==='xml'||(i!=='text'&&/\/xml/i.test(m.contentType))){var d=new ActiveXObject('Microsoft.XMLDOM');d.async=false;try{d.loadXML(m.responseText)}catch(e){d=undefined}if(!d||!d.documentElement||d.getElementsByTagName('parsererror').length){b.code=500;b.message='parseerror';throw'Invalid XML: '+m.responseText;}c.xml=d}}catch(parseMessage){throw parseMessage;}finally{g(b.code,b.message,c,a)}};m.onprogress=function(){};m.onerror=function(){g(500,'error',{text:m.responseText})};if(k.data){h=($.type(k.data)==='string')?k.data:$.param(k.data)}m.open(j.type,j.url);m.send(h)},abort:function(){if(m){m.abort()}}}})})); ///#source 1 1 /Common/CommonFunctions.js //#region ----------- Namespace Declaration --------*/ Type.registerNamespace('sComm'); Type.registerNamespace('sComm.spa'); Type.registerNamespace('sComm.vm'); Type.registerNamespace('sComm.dataModels'); Type.registerNamespace('sComm.dataSources'); Type.registerNamespace('sComm.CommerceApp'); Type.registerNamespace('sComm.CommerceApp.dataSources'); Type.registerNamespace('sComm.vd'); Type.registerNamespace('sComm.rd'); Type.registerNamespace('sComm.constants'); Type.registerNamespace('sComm.currentContext'); Type.registerNamespace('sComm.layouts'); /*Runtime used for main layout. Might need to fix this in future*/ sComm.viewFolderBasePath = "/DesktopModules/sComm/Templates/"; sComm.jSonFilePath = "/DesktopModules/sComm/JsonFiles/"; sComm.fontmodel = []; sComm.WhitePMSColor = "Pantone White"; var uniformEvent = new kendo.Observable(); //#endregion --------------- Namespace Declaration -----------*/ sComm.keepState = function () { var windowsUrl = window.location; var subControlName = sComm.urlParam("subctl"); sComm.currentContext.setLastTab(subControlName); } sComm.getServiceRootUrl = function () { var moduleId = $('#DNNModuleId').val(); var sf = $.ServicesFramework(moduleId); return sf.getServiceRoot('sCommServices'); }; sComm.getsRegServiceRootUrl = function () { var moduleId = $('#DNNModuleId').val(); var sf = $.ServicesFramework(moduleId); return sf.getServiceRoot('sRegMemberServices'); }; sComm.getCookie = function (cookieName) { var name = cookieName + "="; var ca = document.cookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') c = c.substring(1); if (c.indexOf(name) != -1) return c.substring(name.length, c.length); } return undefined; } sComm.SplitTheString = function (str) { var resultArray = null; if (str != null) { var splitChars = ','; if (str.indexOf(splitChars) >= 0) { resultArray = str.split(splitChars); } else { resultArray = str.split(); } } return resultArray; }; sComm.getConfirmationView = function (context) { return si.getTmpl("confirmationPopup-template", "sComm.vm.confirmationPopupModel", context); } sComm.getproductsizechartView = function (context) { return si.getTmpl("productsizechart-template", "sComm.vm.productsizechartModel", context); } sComm._showNotification = function (type, message, title) { if (!message) return; if (!this.notification) { this.notification = $("#notification").kendoNotification({ position: { pinned: true, top: 100, left: function (e) { var lefPosition; var element = $(".k-notification").parent(), eWidth = element.width(), wWidth = $(window).width(), newLeft; newLeft = Math.floor(wWidth / 2 - eWidth / 2); return newLeft; } }, show: function () { $(".k-notification").parent().css({ zIndex: 10005 }); }, autoHideAfter: 4000, stacking: "down", templates: [ { type: "error", template: $("#errorNotificationTemplate").html() }, { type: "success", template: $("#successNotificationTemplate").html() }, { type: "info", template: $("#infoNotificationTemplate").html() }, { type: "warning", template: $("#warningNotificationTemplate").html() } ] }).data("kendoNotification"); } this.notification.show({ title: title, message: message }, type); } sComm._showNoSizeNotification = function (id, scriptId, type, message, title, close) { if (!message) return; if (!this.notification) { this.notification = $(id).kendoNotification({ position: { pinned: true, top: 100, left: function (e) { var lefPosition; var element = $(".k-notification").parent(), eWidth = element.width(), wWidth = $(window).width(), newLeft; newLeft = Math.floor(wWidth / 2 - eWidth / 2); return newLeft; } }, show: function () { $(".k-notification").parent().css({ zIndex: 10005 }); }, autoHideAfter: 0, stacking: "down", templates: [ { type: "error", template: $(scriptId).html() } ] }).data("kendoNotification"); } if (close == true) { this.notification.hide(); } else { this.notification.show({ title: title, message: message }, type); } } sComm.showErrorNotification = function (message) { sComm._showNotification("error", message, "Error"); } sComm.showSuccessNotification = function (message) { sComm._showNotification("success", message, "Successfully Updated"); } sComm.showInfoNotification = function (message) { sComm._showNotification("info", message, "Info"); } sComm.showWarningNotification = function (message) { sComm._showNotification("warning", message, "Warning"); } sComm.showNoSizeErrorNotification = function (id, message, close) { var scriptId = ""; if (id == "noSizeNotificationForStoreUniform") { scriptId = "#errorNotificationTemplate-tmpl"; } else { scriptId = "#errorNotificationTemplate-shoppingcart-tmpl"; } sComm._showNoSizeNotification(id, scriptId, "error", message, "Error", close); } sComm.getPortalThemeColor = function () { var color = $(".json-PortalThemecolor").val(); return color; } sComm.isAdminStoreVisible = function () { return $('.json-IsAdminStoreVisible').val(); } sComm.portalId = function () { return $('.json-PortalId').val(); } sComm.userId = function () { return $('.json-UserId').val(); } sComm.InstanceKey = function () { return $('.json-InstanceKey').val(); } sComm.familyId = function () { return $('.json-FamilyId').val(); } sComm.IsLoggedIn = function () { if ($('.json-UserStatus').val() == "admin" || $('.json-UserStatus').val() == "valid user") { return true; } else { return false; } } sComm.showProgress = function (elementId) { //Need to add k-loading class to that element. kendo.ui.progress($(elementId), true); $(elementId).addClass("k-loading"); } sComm.hideProgress = function (elementId) { kendo.ui.progress($(elementId), false); $(elementId).remove("k-loading"); } sComm.urlParam = function (name) { var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href); return results[1] || 0; } sComm.getThemeWiseColor = function () { var thcolor = sComm.getPortalThemeColor(); if (thcolor == "red") return "#b30000"; else if (thcolor == "blue") return "#1372d3"; else if (thcolor == "green") return "#00690d"; else if (thcolor == "gray") return "#006554"; else return "#aaaaaa"; } sComm.getStoreFrontSelectedMode = function () { if (sComm.getCookie("StoreFrontSelectedMode") == null) { return sComm.currentContext.StoreFrontSelectedMode = "retail"; } else { if (sComm.getCookie("StoreFrontSelectedMode") == "retail") { return "retail"; } else return "fanwear"; } } sComm.setStoreFrontSelectedMode = function (mode) { sComm.currentContext.StoreFrontSelectedMode = mode; } sComm.getisEditModeOpen = function () { if (sComm.getCookie("isEditModeOpen") == null) { return sComm.currentContext.isEditModeOpen = false; } else { return sComm.currentContext.isEditModeOpen; } } sComm.setisEditModeOpen = function (mode) { sComm.currentContext.isEditModeOpen = mode; } sComm.errorDs = function (e) { var message = ""; if (e.responseText) { var msg = JSON.parse(e.responseText); var errorCode = msg.Message; message = stt.get(errorCode); } if (!message || message == "") message = stt.get("systemError"); sComm.showErrorNotification(message); } sComm.CookieEnabled = function () { var cookieEnabled = (navigator.cookieEnabled) ? true : false; if (typeof navigator.cookieEnabled == "undefined" && !cookieEnabled) { document.cookie = "testcookie"; cookieEnabled = (document.cookie.indexOf("testcookie") != -1) ? true : false; } return (cookieEnabled) ? true : false; } $(document).on("click", ".k-overlay", function () { if (sComm.listOfopenedWindows.length <= 0) return; sComm.listOfopenedWindows[sComm.listOfopenedWindows.length - 1].close(); sComm.listOfopenedWindows.pop(); }); sComm.listOfopenedWindows = []; sComm.isShopByCategoryView = false; sComm.isFilterView = false; sComm.ErrorBit = 0; sComm.SelectedColorElementId = 0; sComm.DicksSportsUrl = "https://teamsportshq.dsg.com/"; sComm.loadImages = function (url, callback) { if (url.indexOf("data:image/png;base64,") == -1) { $('').load(function () { callback(); }).error(function () { callback(); setTimeout(function () { sComm.hideProgress("#shoppingCartWindow"); sComm.hideProgress("#secondaryContent"); sComm.hideProgress("#ShoppinCartpopup"); }, 30000); //sComm.showErrorNotification(stt.get("FW0002")); }); } else { $('').load(function () { callback(); }).error(function () { callback(); setTimeout(function () { sComm.hideProgress("#shoppingCartWindow"); sComm.hideProgress("#secondaryContent"); sComm.hideProgress("#ShoppinCartpopup"); }, 30000); //sComm.showErrorNotification(stt.get("FW0002")); }); } } sComm.getisToFilterWithStoreData = function () { if (sComm.getCookie("isToFilterWithStoreData") == null) { return sComm.currentContext.isToFilterWithStoreData = false; } else { return sComm.currentContext.isToFilterWithStoreData; } } sComm.setisToFilterWithStoreData = function (mode) { sComm.currentContext.isToFilterWithStoreData = mode; } sComm.xdrRequest = function (requestModel, xdrinit, successCallBack, errorCallBack, url, timeOut) { var params = JSON.stringify(requestModel); xdrinit.onerror = function () { errorCallBack(); }; xdrinit.onload = function () { successCallBack(); }; xdrinit.timeout = 360000; xdrinit.ontimeout = function () { }; xdrinit.onprogress = function () { }; xdrinit.open("POST", url); if (timeOut > 0) { setTimeout(function () { xdrinit.send(params); }, timeOut); } else { xdrinit.send(params); } } sComm.resample_hermite = function (canvas, width, height, canWidth, canHeight, callback) { canWidth = Math.round(canWidth); canHeight = Math.round(canHeight); var img = canvas.getContext("2d").getImageData(0, 0, width, height); var img2 = canvas.getContext("2d").getImageData(0, 0, canWidth, canHeight); var data = img.data; var data2 = img2.data; var ratioW = width / canWidth; var ratioH = height / canHeight; var ratioWHalf = Math.ceil(ratioW / 2); var ratioHHalf = Math.ceil(ratioH / 2); for (var j = 0; j < canHeight; j++) { for (var i = 0; i < canWidth; i++) { var x2 = (i + j * canWidth) * 4; var weight = 0; var weights = 0; var weightsAlpha = 0; var gxG; var gxB; var gxA; var gxR = gxG = gxB = gxA = 0; var centerY = (j + 0.5) * ratioH; for (var yy = Math.floor(j * ratioH) ; yy < (j + 1) * ratioH; yy++) { var dy = Math.abs(centerY - (yy + 0.5)) / ratioHHalf; var centerX = (i + 0.5) * ratioW; var w0 = dy * dy; //pre-calc part of w for (var xx = Math.floor(i * ratioW) ; xx < (i + 1) * ratioW; xx++) { var dx = Math.abs(centerX - (xx + 0.5)) / ratioWHalf; var w = Math.sqrt(w0 + dx * dx); if (w >= -1 && w <= 1) { //hermite filter weight = 2 * w * w * w - 3 * w * w + 1; if (weight > 0) { dx = 4 * (xx + yy * width); //alpha gxA += weight * data[dx + 3]; weightsAlpha += weight; //colors if (data[dx + 3] < 255) weight = weight * data[dx + 3] / 250; gxR += weight * data[dx]; gxG += weight * data[dx + 1]; gxB += weight * data[dx + 2]; weights += weight; } } } } data2[x2] = gxR / weights; data2[x2 + 1] = gxG / weights; data2[x2 + 2] = gxB / weights; data2[x2 + 3] = gxA / weightsAlpha; } } canvas.getContext("2d").clearRect(0, 0, Math.max(width, canWidth), Math.max(height, canHeight)); canvas.width = canWidth; canvas.height = canHeight; canvas.getContext("2d").imageSmoothingEnabled = true; canvas.getContext("2d").webkitImageSmoothingEnabled = true; canvas.getContext("2d").mozImageSmoothingEnabled = true; canvas.getContext("2d").putImageData(img2, 0, 0); callback(); } sComm.openWindow = function (elementId) { $(elementId).data("kendoWindow").center().open(); } sComm.closeWindow = function (elementId) { $(elementId).data("kendoWindow").close(); } sComm.isContinuedProcessForOrder = false; sComm.CurrentPageNumber = 1; sComm.replaceHtml = function (html) { return sComm.replaceSql(html).replace(//g, ">"); }; sComm.replaceSql = function (html) { return html.trim().replace("select * from", "") .replace("delete from", "") .replace("insert into", "") .replace("select * from", "") .replace("delete from", "") .replace("insert into", "") .replace("update", ""); }; if (!Array.prototype.every) { Array.prototype.every = function (callbackfn, thisArg) { 'use strict'; var T, k; if (this == null) { throw new TypeError('this is null or not defined'); } // 1. Let O be the result of calling ToObject passing the this // value as the argument. var O = Object(this); // 2. Let lenValue be the result of calling the Get internal method // of O with the argument "length". // 3. Let len be ToUint32(lenValue). var len = O.length >>> 0; // 4. If IsCallable(callbackfn) is false, throw a TypeError exception. if (typeof callbackfn !== 'function') { throw new TypeError(); } // 5. If thisArg was supplied, let T be thisArg; else let T be undefined. if (arguments.length > 1) { T = thisArg; } // 6. Let k be 0. k = 0; // 7. Repeat, while k < len while (k < len) { var kValue; // a. Let Pk be ToString(k). // This is implicit for LHS operands of the in operator // b. Let kPresent be the result of calling the HasProperty internal // method of O with argument Pk. // This step can be combined with c // c. If kPresent is true, then if (k in O) { // i. Let kValue be the result of calling the Get internal method // of O with argument Pk. kValue = O[k]; // ii. Let testResult be the result of calling the Call internal method // of callbackfn with T as the this value and argument list // containing kValue, k, and O. var testResult = callbackfn.call(T, kValue, k, O); // iii. If ToBoolean(testResult) is false, return false. if (!testResult) { return false; } } k++; } return true; }; } ///#source 1 1 /Common/CadWorxApi.js var Cadx = Cadx || {}; Cadx.Template = {}; Cadx.Template.Url = { ListTemplates: 'Template/ListTemplates' , ListClipart: 'Template/ListClipart' , ListFonts: 'Template/ListFonts' , Render: 'Template/Render' , ExportToPdf: 'Template/ExportToPdf' , Read: 'Template/Read' , RenderImageWithModel: 'Template/RenderFigureWithModel' }; Cadx.Template.Config = { sid: '0995a716-c74c-4435-a7e1-788ea559ae38', server: $('.json-CadWorxApiPath').val(), AppName: 'BlueSombrero', TemplateSpecificTag: '/designer/templates', FontSpecificTag: '', ClipartSpecificTag: '/designer/clipart' //sid: '820C7A94-7901-4E44-954B-F2B4686C42D5' //, server: 'http://stahls/CadXWeb/' //, AppName: 'Dev' //, TemplateSpecificTag: '/templates/documents' //, FontSpecificTag: '' //, ClipartSpecificTag: '/templates/clipart' // Can run against blue sombrero locally by switching dev configuration to point at blue sombrero settings... //sid: '0995a716-c74c-4435-a7e1-788ea559ae38' //, server: 'http://stahls/CadXWeb/' //, AppName: 'Dev' //, TemplateSpecificTag: '/designer/templates' //, FontSpecificTag: '' //, ClipartSpecificTag: '/designer/clipart' }; Cadx.Template.RequestModel = { Ident: { SessionId: Cadx.Template.Config.sid, SuperUser: false }, Model: { TemplateId: "@templateId", Tag: "/designer/clipart" }, Config: Cadx.Template.Config.AppName }; Cadx.Template.Assert = function (e, n) { if (!e) { var a = "Assertion failed! " + (n ? "\n" + n : ""); alert(a); } return e; } Cadx.Template.ajax$ = function (url, data, type, dataType, contentType) { return $.ajax({ type: type || 'POST' , data: data , contentType: contentType || 'text/plain; charset=utf-8' //'application/json; charset=utf-8' , dataType: dataType || 'JSON' , timeout: 60000 , url: url }); } Cadx.Template.ajaxRequest$ = function (url, requestModel, method, responseType, options) { var coreUrl = Cadx.Template.Config.server + url; requestModel = JSON.stringify(requestModel); return Cadx.Template.ajax$(coreUrl, requestModel, method, responseType); } Cadx.Template.request$ = function (url, requestModel, method, responseType, options) { return this.ajaxRequest$(url, requestModel, method, responseType, options) .then(function (response) { if (response.Success !== undefined) { if (response.Success === false) { var error = response.Error || null; alert('Error contacting Template API' + error); } else return response.Model; } return response; }); } Cadx.Template.ListTemplates$ = function (requestModel) { Cadx.Template.Assert(requestModel, "Request model undefined for Template.ListTemplates"); return Cadx.Template.request$(Cadx.Template.Url.ListTemplates, requestModel); }; Cadx.Template.ListClipart$ = function (requestModel) { Cadx.Template.Assert(requestModel, "Request model undefined for Template.ListClipart"); return Cadx.Template.request$(Cadx.Template.Url.ListClipart, requestModel); }; Cadx.Template.ListFonts$ = function (requestModel) { Cadx.Template.Assert(requestModel, "Request model undefined for Template.ListFonts"); return Cadx.Template.request$(Cadx.Template.Url.ListFonts, requestModel); }; Cadx.Template.Render$ = function (requestModel) { Cadx.Template.Assert(requestModel, "Request model undefined for Template.Render"); return Cadx.Template.request$(Cadx.Template.Url.Render, requestModel); }; Cadx.Template.ExportToPdf$ = function (requestModel) { Cadx.Template.Assert(requestModel, "Request model undefined for Template.ExportToPdf"); return Cadx.Template.request$(Cadx.Template.Url.ExportToPdf, requestModel); }; Cadx.Template.ReadById$ = function (cadworxTemplateId, scope, callBack) { var model = Cadx.Template.RequestModel; model.Model.TemplateId = cadworxTemplateId; Cadx.Template.Read$(model) .then(function (responseModel) { callBack.call(scope, responseModel); }); } Cadx.Template.Read$ = function (requestModel) { Cadx.Template.Assert(requestModel, "Request model undefined for Template.Read"); return Cadx.Template.request$(Cadx.Template.Url.Read, requestModel); }; Cadx.Template.RenderImageWithModel$ = function (requestModel) { Cadx.Template.Assert(requestModel, "Request model undefined for Template.RenderImageWithModel"); return Cadx.Template.request$(Cadx.Template.Url.RenderImageWithModel, requestModel); }; ///#source 1 1 /Common/CurrentContext.js Object.defineProperty(sComm.currentContext, "StoreFrontSelectedMode", { _storeFrontMode: null, get: function () { this._storeFrontMode = sComm.getCookie("StoreFrontSelectedMode"); if (this._storeFrontMode) this._storeFrontMode = this._storeFrontMode.toString(); return this._storeFrontMode; }, set: function (newstorefrontselectedview) { var expiryDuration = new Date(); expiryDuration.setTime(expiryDuration.getTime() + (60 * 60 * 1000)); document.cookie = "StoreFrontSelectedMode=" + newstorefrontselectedview + "; " + expiryDuration; this._storeFrontMode = newstorefrontselectedview; }, }); Object.defineProperty(sComm.currentContext, "isEditModeOpen", { _isEditModeOpen: null, get: function () { this._isEditModeOpen = sComm.getCookie("isEditModeOpen"); if (this._isEditModeOpen) this._isEditModeOpen = this._isEditModeOpen.toString(); return this._isEditModeOpen; }, set: function (newsisEditModeOpen) { var expiryDuration = new Date(); expiryDuration.setTime(expiryDuration.getTime() + (60 * 60 * 1000)); document.cookie = "isEditModeOpen=" + newsisEditModeOpen + "; " + expiryDuration; this._isEditModeOpen = newsisEditModeOpen; }, }); sComm.webdb = {}; sComm.currentContext.setSettings = function (purchase) { var purchaseJson = JSON.stringify(purchase); localStorage.setItem("settings", purchaseJson); }; sComm.currentContext.getSettings = function (readcallback) { var settings = JSON.parse(localStorage.getItem("settings")); readcallback(settings); }; sComm.currentContext.setCheckoutInfo = function (checkOutInfo) { var purchaseJson = JSON.stringify(checkOutInfo); localStorage.setItem("checkoutInfo", purchaseJson); }; sComm.currentContext.getCheckoutInfo = function () { var settings = JSON.parse(localStorage.getItem("checkoutInfo")); return settings; }; sComm.currentContext.setOrderSummary = function (orderSummary) { var orderSummaryJson = JSON.stringify(orderSummary); localStorage.setItem("orderSummary", orderSummaryJson); }; sComm.currentContext.getOrderSummary = function () { var orderSummary = JSON.parse(localStorage.getItem("orderSummary")); return orderSummary; }; sComm.currentContext.setFanwearWizardSingleProduct = function (purchase) { var fanwearWizardSingleProductJson = JSON.stringify(purchase); localStorage.setItem("fanwearWizardSingleProduct", fanwearWizardSingleProductJson); }; sComm.currentContext.getFanwearWizardSingleProduct = function () { var fanwearWizardSingleProductJson = JSON.parse(localStorage.getItem("fanwearWizardSingleProduct")); return fanwearWizardSingleProductJson; }; sComm.currentContext.setFanwearWizardSelectedCustomTemplate = function (template) { var fanwearWizardSelectedCustomJson = JSON.stringify(template); localStorage.setItem("fanwearWizardSelectedCustomTemplate", fanwearWizardSelectedCustomJson); }; sComm.currentContext.getFanwearWizardSelectedCustomTemplate = function () { var fanwearWizardSelectedCustomJson = JSON.parse(localStorage.getItem("fanwearWizardSelectedCustomTemplate")); return fanwearWizardSelectedCustomJson; }; sComm.currentContext.setArtworkCalculatedPoints = function (template) { var fanwearWizardSelectedCustomJson = JSON.stringify(template); localStorage.setItem("artworkCalculatedPoints", fanwearWizardSelectedCustomJson); }; sComm.currentContext.getArtworkCalculatedPoints = function () { var fanwearWizardSelectedCustomJson = JSON.parse(localStorage.getItem("artworkCalculatedPoints")); return fanwearWizardSelectedCustomJson; }; sComm.currentContext.setIsCustomTemplateToload = function (flag) { localStorage.setItem("IsCustomTemplateToload", flag); }; sComm.currentContext.getIsCustomTemplateToload = function () { var isCustomTemplateToload = localStorage.getItem("IsCustomTemplateToload"); if (isCustomTemplateToload == "false") { return false; } else if (isCustomTemplateToload == "true") { return true; } else { return true; } }; sComm.currentContext.setCheckoutUserLoggedInStaus = function (value) { localStorage.setItem("isGuestCheckOutOrLoggedIn", value); }; sComm.currentContext.getCheckoutUserLoggedInStaus = function () { if (sComm.IsLoggedIn() == 'True') return true; return localStorage.getItem("isGuestCheckOutOrLoggedIn"); }; sComm.currentContext.setSelectedColorId = function (value) { localStorage.setItem("SelectedColorId", value); }; sComm.currentContext.getSelectedColorId = function () { if (localStorage.getItem("SelectedColorId") == null) return 0; return localStorage.getItem("SelectedColorId"); }; Object.defineProperty(sComm.currentContext, "isToFilterWithStoreData", { _isToFilterWithStoreData: null, get: function () { this._isToFilterWithStoreData = sComm.getCookie("isToFilterWithStoreData"); if (this._isToFilterWithStoreData) this._isToFilterWithStoreData = this._isToFilterWithStoreData.toString(); return this._isToFilterWithStoreData; }, set: function (isToFilterWithStoreData) { var expiryDuration = new Date(); expiryDuration.setTime(expiryDuration.getTime() + (60 * 60 * 1000)); document.cookie = "isToFilterWithStoreData=" + isToFilterWithStoreData + "; " + expiryDuration; this._isToFilterWithStoreData = isToFilterWithStoreData; } }); sComm.currentContext.setGenderName = function (value) { localStorage.setItem("genderName", value); }; sComm.currentContext.getGenderName = function () { if (localStorage.getItem("genderName") == null) return 0; return localStorage.getItem("genderName"); }; sComm.currentContext.setCategoryId = function (value) { localStorage.setItem("CategoryId", value); }; sComm.currentContext.getCategoryId = function () { if (localStorage.getItem("CategoryId") == null) return 0; return localStorage.getItem("CategoryId"); }; sComm.currentContext.setCategoryName = function (value) { localStorage.setItem("CategoryName", value); }; sComm.currentContext.getCategoryName = function () { if (localStorage.getItem("CategoryName") == null) return 0; return localStorage.getItem("CategoryName"); }; sComm.currentContext.setFanwearProductData = function (data) { var fanwearWizardSelectedCustomJson = JSON.stringify(data); localStorage.setItem("fanwearProductData", fanwearWizardSelectedCustomJson); }; sComm.currentContext.getFanwearProductData = function () { var fanwearWizardSelectedCustomJson = JSON.parse(localStorage.getItem("fanwearProductData")); return fanwearWizardSelectedCustomJson; }; sComm.currentContext.setVisibleStep = function (value) { localStorage.setItem("StepName", value); }; sComm.currentContext.getVisibleStep = function () { if (localStorage.getItem("StepName") == "" || localStorage.getItem("StepName") == null) return ""; return localStorage.getItem("StepName"); }; ///#source 1 1 /Common/si.js Type.registerNamespace('si'); (function () { var instances = {}; var templates = {}; function getType(typeName) { var arr = typeName.split("."); var fn = (window || this); for (var i = 0, len = arr.length; i < len; i++) { fn = fn[arr[i]]; } if (typeof fn !== "function") { throw new Error("function not found"); } return fn; }; function createInstance(typeName, context) { var t = getType(typeName); if (!context) return new t(); return new t(context); } function validateType(obj) { for (var i = 1, len = arguments.length; i < len; i++) { if (typeof obj == arguments[i]) { return; } } throw new Error("Invalid parameter type"); } si.get = function (typeName, context, construct) { var retVal = si.getIfExists(typeName, context); if (retVal) return retVal; if (!context) { context = ""; } var contextBasedType = typeName + context; if (typeof (construct) === "undefined") { instances[contextBasedType] = createInstance(typeName, context); } else { instances[contextBasedType] = construct(context); } return instances[contextBasedType]; }; si.remove = function (typeName, context) { var retVal = si.getIfExists(typeName, context); if (!retVal) return; var contextBasedType = typeName + context; delete instances[contextBasedType]; }; si.getIfExists = function (typeName, context) { validateType(typeName, "string"); validateType(context, "undefined", "string"); if (!context) { context = ""; } var contextBasedType = typeName + context; return instances[contextBasedType]; } si.getTmpl = function (templateSelector, model, context, templateConstruct, modelConstruct) { validateType(templateSelector, "string"); validateType(context, "undefined", "string"); if (!context) { context = ""; } var contextBasedTemplate = templateSelector + context; var retVal = templates[contextBasedTemplate]; if (!retVal) { if (templateConstruct) { retVal = templateConstruct(context); } else { if (typeof model == "string" && model.length > 0) { model = si.get(model, context, modelConstruct); } retVal = new kendo.View(templateSelector, { model: model }); } retVal.bind("show", function () { retVal.model.set("isViewVisible", true); }) .bind("hide", function () { retVal.model.set("isViewVisible", false); }); templates[contextBasedTemplate] = retVal; } return retVal; } })(); ///#source 1 1 /Common/KendoBindings.js (function ($, window, document, undefined) { var kendo = window.kendo, binders = kendo.data.binders, Binder = kendo.data.Binder; function findDataIndexFromArray(data, Array) { var idx = -1; $.map(Array, function (selectedcolor, ind) { if (selectedcolor.ProductId == data.ProductId) { idx = ind; return false; } }); return idx; } kendo.data.binders.widget.min = kendo.data.Binder.extend({ init: function (widget, bindings, options) { //call the base constructor kendo.data.Binder.fn.init.call(this, widget.element[0], bindings, options); }, refresh: function () { var that = this, value = that.bindings["min"].get(); //get the value from the View-Model $(that.element).data("kendoDatePicker").min(value); //update the widget } }); kendo.data.binders.widget.tooltip = { value: kendo.data.Binder.extend({ refresh: function () { var that = this; var tooltip = this.element; if (this._showHandler) { tooltip.unbind("show", this._showHandler); } else { this._showHandler = function () { tooltip.content.html(that.bindings["value"].get()); }; } tooltip.bind("show", this._showHandler); } }) }; binders.applyFetureBeautifyCheckbox = Binder.extend({ init: function (element, bindings, options) { //call the base constructor Binder.fn.init.call(this, element, bindings, options); var divElement = $(this.element); divElement.on('change', function (e) { var data = e.currentTarget.kendoBindingTarget.source; var model = si.get("sComm.vm.productMultipleEditModel"); var selectedArray = model.get("SelectedProducts"); var indx = findDataIndexFromArray(data, selectedArray); if (this.checked) { data.set("IsHidden", false); data.set("IsFeatured", true); if (indx != -1) { selectedArray[indx].set("IsHidden", false); selectedArray[indx].set("IsFeatured", true); } var next = divElement.parent()[0].nextElementSibling; $(next).children("span.b-checkbox").removeClass("true").addClass("false"); } else { data.set("IsFeatured", false); if (indx != -1) selectedArray[indx].set("IsFeatured", false); } model.changeBtnText(); }); }, refresh: function (e) { } }); binders.applyHiddenBeautifyCheckbox = Binder.extend({ init: function (element, bindings, options) { //call the base constructor Binder.fn.init.call(this, element, bindings, options); var divElement = $(this.element); divElement.on('change', function (e) { var data = e.currentTarget.kendoBindingTarget.source; var model = si.get("sComm.vm.productMultipleEditModel"); var selectedArray = model.get("SelectedProducts"); var indx = findDataIndexFromArray(data, selectedArray); if (this.checked) { data.set("IsFeatured", false); data.set("IsHidden", true); if (indx != -1) { selectedArray[indx].set("IsFeatured", false); selectedArray[indx].set("IsHidden", true); } var prev = divElement.parent()[0].previousElementSibling; $(prev).children("span.b-checkbox").removeClass("true").addClass("false"); } else { data.set("IsHidden", false); if (indx != -1) selectedArray[indx].set("IsHidden", false); } model.changeBtnText(); }); }, refresh: function () { } }); binders.applyHiddenBeautifyCheckboxforsetting = Binder.extend({ init: function (element, bindings, options) { //call the base constructor Binder.fn.init.call(this, element, bindings, options); var divElement = $(this.element); divElement.on('change', function (e) { var data = e.currentTarget.kendoBindingTarget.source; if (this.checked) { data.product.set("IsFeatured", false); data.product.set("IsHidden", true); data.product.set("IsRecommended", false); } else { data.product.set("IsHidden", false); } if (data.product.get("IsHidden")) { if (!data.product.get("IsFeatured")) { $(".featuredDiv").siblings("span.b-checkbox").removeClass("true").addClass("false"); $(".recommendedDiv").siblings("span.b-checkbox").removeClass("true").addClass("false"); } } }); }, refresh: function (e) { } }); binders.applyFeatureBeautifyCheckboxforsetting = Binder.extend({ init: function (element, bindings, options) { //call the base constructor Binder.fn.init.call(this, element, bindings, options); var divElement = $(this.element); divElement.on('change', function (e) { var data = e.currentTarget.kendoBindingTarget.source; if (this.checked) { data.product.set("IsHidden", false); data.product.set("IsFeatured", true); } else { data.product.set("IsFeatured", false); } if (data.product.get("IsFeatured")) { if (!data.product.get("IsHidden")) { $(".hiddenDiv").siblings("span.b-checkbox").removeClass("true").addClass("false"); } } }); }, refresh: function (e) { } }); binders.applyRecommendedBeautifyCheckboxforsetting = Binder.extend({ init: function (element, bindings, options) { //call the base constructor Binder.fn.init.call(this, element, bindings, options); var divElement = $(this.element); divElement.on('change', function (e) { var data = e.currentTarget.kendoBindingTarget.source; if (this.checked) { data.product.set("IsRecommended", true); data.product.set("IsHidden", false); } else { data.product.set("IsRecommended", false); } if (data.product.get("IsRecommended")) { if (!data.product.get("IsHidden")) { $(".hiddenDiv").siblings("span.b-checkbox").removeClass("true").addClass("false"); } } }); }, refresh: function (e) { } }); binders.isAnyChecked = Binder.extend({ init: function (element, bindings, options) { //call the base constructor Binder.fn.init.call(this, element, bindings, options); var divElement = $(this.element); divElement.on('change', function (e) { var that = si.get("sComm.vm.filterStorefrontListModel"); var storeFront = si.get("sComm.vm.storeFrontListModel"); var isSelected; var index = 0; var data = e.currentTarget.kendoBindingTarget.source; if (storeFront.get("isSingleLeft")) { if (!this.checked) { data.set("isChecked", false); that.clearStoredData(); storeFront.loadStoreDs(); } } if (this.checked) { data.set("isChecked", true); } else { data.set("isChecked", false); } $.map(that.get("genderArray"), function (val, i) { if (val.isChecked) { isSelected = true; index++; } }); $.map(that.get("brandDs"), function (val, i) { if (val.isChecked) { isSelected = true; index++; } }); $.map(that.get("categoryDs"), function (val, i) { if (val.isChecked) { isSelected = true; index++; } }); $.map(that.get("filterArray"), function (val, i) { if (val.isChecked) { isSelected = true; index++; } }); $.map(that.get("filterArrayForHidden"), function (val, i) { if (val.isChecked) { isSelected = true; index++; } }); $.map(that.get("ageRangeDs"), function (val, i) { if (val.isChecked) { isSelected = true; index++; } }); if (isSelected) { that.layoutManager.setClearFilterVisibility(true); } else { that.layoutManager.setClearFilterVisibility(false); } if (isSelected) { that.filterContent(); } if (index == 1) { storeFront.set("isSingleLeft", true); } else { storeFront.set("isSingleLeft", false); } }); }, refresh: function () { } }); binders.checkTheItem = Binder.extend({ init: function (element, bindings, options) { //call the base constructor Binder.fn.init.call(this, element, bindings, options); var divElement = $(this.element); var storeFrontVm = si.get("sComm.vm.storeFrontListModel"); var id = bindings.attr.value.source.ProductId; if (storeFrontVm.selectedItems.length != 0) { if (storeFrontVm.selectedItems.indexOf(id) != -1) { divElement.attr('checked', true); } } divElement.on('change', function (e) { var data = e.currentTarget.kendoBindingTarget.source; var index = storeFrontVm.selectedItems.indexOf(data.ProductId); if (index == -1) { if (divElement.prop('checked') == true) { storeFrontVm.selectedItems.push(data.ProductId); divElement.attr('checked', true); } } else { if (divElement.prop('checked') == false) { storeFrontVm.selectedItems.splice(index, 1); divElement.attr('checked', false); } } var isAnySelected = false; $('.checkBoxToEdit').each(function () { if (this.checked) { isAnySelected = true; return false; } }); storeFrontVm.set('IsEditItemVisible', isAnySelected); }); }, refresh: function () { } }); binders.checkTheTemplate = Binder.extend({ init: function (element, bindings, options) { //call the base constructor Binder.fn.init.call(this, element, bindings, options); var divElement = $(this.element); divElement.on('change', function (e) { var data = e.currentTarget.kendoBindingTarget.source; if (this.checked) { data.set("IsChecked", true); } else { data.set("IsChecked", false); } var figures = data.TemplateModel.Model.Figures; var isAnyBalnk = false; var hasChanged = false; if (data.get("IsChecked") == true) { $.map(figures, function (figure, id) { if (figure.Lines[0].trim() == "") { isAnyBalnk = true; } if (figure.get("Lines[0]") != figure.get("OldText")) { hasChanged = true; } }); if (isAnyBalnk) { data.set("IsBlank", true); data.set("IsToUpdateTemplate", false); $('.confirmChoicesForFanwear').removeAttr('disabled'); } else { if (hasChanged) { data.set("IsBlank", false); data.set("IsToUpdateTemplate", true); $('.confirmChoicesForFanwear').attr('disabled', 'disabled'); } } } else { data.set("IsBlank", false); data.set("IsToUpdateTemplate", false); var fanwearModel = si.get("sComm.vm.fanwearModel"); var templates = fanwearModel.get("fanwearDetailDs"); var isAnyTobeChanged = false; for (var j = 0; j < templates.data().length; j++) { if (templates.data()[j].get("IsChecked") == true) { if (templates.data()[j].get("IsToUpdateTemplate") == true) { isAnyTobeChanged = true; break; } } } if (!isAnyTobeChanged) { $('.confirmChoicesForFanwear').removeAttr('disabled'); } } }); }, refresh: function () { } }); binders.oneImgOfProductIsDisplay = Binder.extend({ refresh: function (e) { var that = $(this.element); var value = this.bindings["oneImgOfProductIsDisplay"].get(); if (value == 1) { that.parent().parent()[0].className = "col-md-12 text-center"; } else that.parent().parent()[0].className = "col-md-10 text-right"; } }); binders.isAnyCheckedForFanwear = Binder.extend({ init: function (element, bindings, options) { //call the base constructor Binder.fn.init.call(this, element, bindings, options); var divElement = $(this.element); divElement.on('change', function (e) { var that = si.get("sComm.vm.filterFanwearListModel"); that.set("isBrowserBack", false); var fanwear = si.get("sComm.vm.fanwearListModel"); var isSelected; var index = 0; var data = e.currentTarget.kendoBindingTarget.source; if (fanwear.get("isSingleLeft")) { if (!this.checked) { data.set("isChecked", false); that.clearStoredData(); fanwear.loadFanwearDs(); } } if (this.checked) { data.set("isChecked", true); } else { data.set("isChecked", false); } var filterContent = window.location.href.split("/filterFanwear")[1]; var newFilterContent = "/filterFanwear"; var selectedGenders = ""; var selectedGendersArray = []; $.map(that.get("genderArray"), function (val, i) { if (val.isChecked) { isSelected = true; index++; selectedGendersArray.push(val.value); } }); selectedGenders = selectedGendersArray.join(","); if (selectedGenders != "" && newFilterContent.indexOf("gender=") == -1) { if (newFilterContent.indexOf("/filterFanwear/") == -1) { newFilterContent = newFilterContent + "/gender=" + selectedGenders; } else { newFilterContent = newFilterContent + "&gender=" + selectedGenders; } } var selectedBrands = ""; var selectedBrandsArray = []; $.map(that.get("brandDs"), function (val, i) { if (val.isChecked) { isSelected = true; index++; selectedBrandsArray.push(val.BrandId); } }); selectedBrands = selectedBrandsArray.join(","); if (selectedBrands != "" && newFilterContent.indexOf("brands=") == -1) { if (newFilterContent.indexOf("/filterFanwear/") == -1) { newFilterContent = newFilterContent + "/brands=" + selectedBrands; } else { newFilterContent = newFilterContent + "&brands=" + selectedBrands; } } var selectedActivities = ""; var selectedActivitiesArray = []; $.map(that.get("activityTypeDs"), function (val, i) { if (val.isChecked) { isSelected = true; index++; selectedActivitiesArray.push(val.ActivityTypeId); } }); selectedActivities = selectedActivitiesArray.join(","); if (selectedActivities != "" && newFilterContent.indexOf("activities=") == -1) { if (newFilterContent.indexOf("/filterFanwear/") == -1) { newFilterContent = newFilterContent + "/activities=" + selectedActivities; } else { newFilterContent = newFilterContent + "&activities=" + selectedActivities; } } var selectedCategory = ""; var selectedCategoryArray = []; $.map(that.get("categoryDs"), function (val, i) { if (val.isChecked) { isSelected = true; index++; selectedCategoryArray.push(val.CategoryId); } }); selectedCategory = selectedCategoryArray.join(","); if (selectedCategory != "" && newFilterContent.indexOf("category=") == -1) { if (newFilterContent.indexOf("/filterFanwear/") == -1) { newFilterContent = newFilterContent + "/category=" + selectedCategory; } else { newFilterContent = newFilterContent + "&category=" + selectedCategory; } } $.map(that.get("filterArray"), function (val, i) { if (val.isChecked) { isSelected = true; index++; if (newFilterContent.indexOf("featured=true") == -1) { if (newFilterContent.indexOf("/filterFanwear/") == -1) { newFilterContent = newFilterContent + "/featured=true"; } else { newFilterContent = newFilterContent + "&featured=true"; } } } }); $.map(that.get("filterArrayForHidden"), function (val, i) { if (val.isChecked) { isSelected = true; index++; if (newFilterContent.indexOf("hidden=true") == -1) { if (newFilterContent.indexOf("/filterFanwear/") == -1) { newFilterContent = newFilterContent + "/hidden=true"; } else { newFilterContent = newFilterContent + "&hidden=true"; } } } }); var selectedAgeRange = ""; var selectedAgeRangeArray = []; $.map(that.get("ageRangeDs"), function (val, i) { if (val.isChecked) { isSelected = true; index++; selectedAgeRangeArray.push(val.AgeGroupId); } }); selectedAgeRange = selectedAgeRangeArray.join(","); if (selectedAgeRange != "" && newFilterContent.indexOf("ageGroup=") == -1) { if (newFilterContent.indexOf("/filterFanwear/") == -1) { newFilterContent = newFilterContent + "/ageGroup=" + selectedAgeRange; } else { newFilterContent = newFilterContent + "&ageGroup=" + selectedAgeRange; } } if (isSelected) { that.layoutManager.setClearFilterVisibility(true); } else { that.layoutManager.setClearFilterVisibility(false); } if (isSelected) { that.filterContent(); } if (index == 1) { fanwear.set("isSingleLeft", true); } else { fanwear.set("isSingleLeft", false); } if (filterContent != "") { window.location.href = window.location.href.replace(filterContent, newFilterContent.split("/filterFanwear")[1]); } else { window.location.href = window.location.href + newFilterContent.split("/filterFanwear")[1]; } }); }, refresh: function () { } }); binders.checkTheItemForFanwear = Binder.extend({ init: function (element, bindings, options) { //call the base constructor Binder.fn.init.call(this, element, bindings, options); var divElement = $(this.element); var fanwearVm = si.get("sComm.vm.fanwearListModel"); var id = bindings.attr.value.source.ProductId; if (fanwearVm.selectedItems.length != 0) { if (fanwearVm.selectedItems.indexOf(id) != -1) { divElement.attr('checked', true); } } divElement.on('change', function (e) { var data = e.currentTarget.kendoBindingTarget.source; var index = fanwearVm.selectedItems.indexOf(data.ProductId); if (index == -1) { if (divElement.prop('checked') == true) { fanwearVm.selectedItems.push(data.ProductId); divElement.attr('checked', true); } } else { if (divElement.prop('checked') == false) { fanwearVm.selectedItems.splice(index, 1); divElement.attr('checked', false); } } var isAnySelected = false; $('.checkBoxToEdit').each(function () { if (this.checked) { isAnySelected = true; return false; } }); fanwearVm.set('IsEditItemVisible', isAnySelected); }); }, refresh: function () { } }); function findColorIndexFromArray(color, colorArray) { var idx = -1; $.map(colorArray, function (selectedcolor, ind) { if (selectedcolor.PrimaryColorId == color.PrimaryColorId) { idx = ind; return false; } }); return idx; } binders.checkTheColorItem = Binder.extend({ init: function (element, bindings, options) { Binder.fn.init.call(this, element, bindings, options); var divElement = $(this.element); var productVm = si.get("sComm.vm.productEditModel"); divElement.on('change', function (e) { var data = e.currentTarget.kendoBindingTarget.source; var indexofcolor = -1; productVm.set("IsColorActionChanged", true); var isChecked = divElement.prop("checked"); var isAnySelected = false; $('.checkBoxToEdit').each(function () { if (this.checked) { isAnySelected = true; return false; } }); if (isAnySelected) { if (isChecked == true) { // checkbox is checked if (data.get("IsActive") == false) { productVm.selectedColorItems.push(data); var idx = findColorIndexFromArray(data, productVm.notSelectedColorItems); if (idx >= 0) productVm.notSelectedColorItems.splice(idx, 1); data.set("IsActive", true); divElement.attr('checked', true); } } else { //checkbox is unchecked if (data.get("IsActive") == true) { productVm.notSelectedColorItems.push(data); var idx2 = findColorIndexFromArray(data, productVm.selectedColorItems); if (idx2 >= 0) productVm.selectedColorItems.splice(idx2, 1); data.set("IsActive", false); divElement.attr('checked', false); } } } else { if (isChecked == false) { divElement.attr('checked', true); } else { divElement.attr('checked', false); } } var colorindex = productVm.get("product").Colors.indexOf(data); if (productVm.get("product").PrimaryColorId == data.PrimaryColorId) { if (divElement.prop('checked') == false) { var dropdown = $('#storedefaultfrontcolorlist').data('kendoDropDownList'); dropdown.value(-1); productVm.product.set("PrimaryColorId", 0); productVm.get("product").Colors[colorindex].set("IsAvailable", false); } } else { if (divElement.prop('checked') == false) productVm.get("product").Colors[colorindex].set("IsAvailable", false); else productVm.get("product").Colors[colorindex].set("IsAvailable", true); } }); }, refresh: function () { } }); binders.checkTheSizeArrayItem = Binder.extend({ init: function (element, bindings, options) { Binder.fn.init.call(this, element, bindings, options); var divElement = $(this.element); var vm = sComm.vm.unifromDetailGridDisplayModel; divElement.on('change', function (e) { var data = e.currentTarget.kendoBindingTarget.source; var isChecked = divElement.prop("checked"); if (isChecked == false) { divElement.attr('checked', false); data.set("IsSelected", false); } else { divElement.attr('checked', true); data.set("IsSelected", true); } var isAnySelected = false; $.map(data.parent(), function (sizedata, sizeindex) { if (sizedata.get("IsSelected") == true) { isAnySelected = true; } if (sizeindex == data.parent().length - 1) { if (isAnySelected) { } else { if (isChecked == false) { divElement.attr('checked', true); data.set("IsSelected", true); } else { divElement.attr('checked', false); data.set("IsSelected", false); } } } }); }); }, refresh: function () { } }); binders.applyHiddenBeautifyCheckboxForFanwear = Binder.extend({ init: function (element, bindings, options) { //call the base constructor Binder.fn.init.call(this, element, bindings, options); var divElement = $(this.element); divElement.on('change', function (e) { var that = si.get("sComm.vm.designReviewModel"); if (this.checked) { that.set("featuredChecked", false); that.set("hiddenChecked", true); } else { that.set("hiddenChecked", false); } if (that.get("hiddenChecked")) { if (!that.get("featuredChecked")) { $(".featuredDiv").siblings("span.b-checkbox").removeClass("true").addClass("false"); } } }); }, refresh: function (e) { } }); binders.applyFeatureBeautifyCheckboxForFanwear = Binder.extend({ init: function (element, bindings, options) { //call the base constructor Binder.fn.init.call(this, element, bindings, options); var divElement = $(this.element); divElement.on('change', function (e) { var that = si.get("sComm.vm.designReviewModel"); if (this.checked) { that.set("hiddenChecked", false); that.set("featuredChecked", true); } else { that.set("featuredChecked", false); } if (that.get("featuredChecked")) { $(".featuredDiv").siblings("span.b-checkbox").removeClass("false").addClass("true"); if (!that.get("hiddenChecked")) { $(".hiddenDiv").siblings("span.b-checkbox").removeClass("true").addClass("false"); } } }); }, refresh: function (e) { } }); binders.onIdFocusOut = Binder.extend({ init: function (element, bindings, options) { //call the base constructor Binder.fn.init.call(this, element, bindings, options); var divElement = $(this.element); divElement.on('blur', function (e) { var templateId = $("#CadworxTemplateId").val(); var viewModel = sComm.vm.fanwearTemplateSettingsModel; if (templateId == "") { viewModel.set("CadworxTemplateIdMsg", true); } else { viewModel.set("CadworxTemplateIdMsg", false); } var re = /^[A-Za-z0-9]{8}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{12}$/i; if (!templateId.match(re)) { viewModel.set("CadworxTemplateWrongIdMsg", true); } else { viewModel.set("CadworxTemplateWrongIdMsg", false); } }); }, refresh: function (e) { } }); binders.checkTheActivity = Binder.extend({ init: function (element, bindings, options) { //call the base constructor Binder.fn.init.call(this, element, bindings, options); var divElement = $(this.element); divElement.on('change', function (e) { sComm.vm.activityTypeSelectionModel.set("hasAnyChange", true); var isAnySelectedActivity = false; var isAnySelectedBrand = false; var isNewStore = sComm.vm.activityTypeSelectionModel.isFirstStoreSetup; if (isNewStore == true) { var data = e.currentTarget.kendoBindingTarget.source; if (this.checked == false) { var portalActivities = $(".json-hdnRegistrationActivity").val(); if (portalActivities != null && portalActivities != "") { var selected = sComm.vm.activityTypeSelectionModel.allActvitiesSelected.filter(function (val, i) { return val == data.ActivityTypeId; }); if (selected.length > 0) { sComm.vm.activityTypeSelectionModel.openDialog(data); } } } } $('.convertedActivity').each(function () { if (this.checked) { isAnySelectedActivity = true; return false; } }); $('.convertedBrand').each(function () { if (this.checked) { isAnySelectedBrand = true; return false; } }); if (isAnySelectedActivity && isAnySelectedBrand) { sComm.vm.activityTypeSelectionModel.set("isVisible", true); } else { sComm.vm.activityTypeSelectionModel.set("isVisible", false); } }); }, refresh: function () { } }); binders.checkTheBrand = Binder.extend({ init: function (element, bindings, options) { //call the base constructor Binder.fn.init.call(this, element, bindings, options); var divElement = $(this.element); divElement.on('change', function (e) { sComm.vm.activityTypeSelectionModel.set("hasAnyChange", true); var isAnySelectedActivity = false; var isAnySelectedBrand = false; $('.convertedActivity').each(function () { if (this.checked) { isAnySelectedActivity = true; return false; } }); $('.convertedBrand').each(function () { if (this.checked) { isAnySelectedBrand = true; return false; } }); if (isAnySelectedActivity && isAnySelectedBrand) { sComm.vm.activityTypeSelectionModel.set("isVisible", true); } else { sComm.vm.activityTypeSelectionModel.set("isVisible", false); } }); }, refresh: function () { } }); binders.checkIfTextIsBlank = Binder.extend({ init: function (element, bindings, options) { //call the base constructor Binder.fn.init.call(this, element, bindings, options); var divElement = $(this.element); divElement.on('blur', function (e) { var data = e.currentTarget.kendoBindingTarget.source; var figures = data.parent().parent().Figures; var isAnyBalnk = false; $.map(figures, function (figure, id) { if (figure.Lines[0].trim() == "") { isAnyBalnk = true; } }); if (isAnyBalnk) { data.parent().parent().parent().parent().set("IsBlank", true); data.parent().parent().parent().parent().set("IsToUpdateTemplate", false); } else { data.parent().parent().parent().parent().set("IsBlank", false); } }); }, refresh: function (e) { } }); binders.focusout = Binder.extend({ init: function (element, bindings, options) { Binder.fn.init.call(this, element, bindings, options); var divElement = $(this.element); var textfontvm = si.get("sComm.vm.textOrFontSelectionModel"); divElement.bind("focusout", function (ev) { textfontvm.set("maxlen", 0); var dt = ev.currentTarget.kendoBindingTarget.source; var isAllBalnk = false; var isAllBlankLength = 0; if (dt.get("TextInput") != null) { $(ev.currentTarget).val(sComm.replaceHtml(dt.get("TextInput"))); dt.set("Lines[0]", sComm.replaceHtml($(ev.currentTarget).val())); } $.map(dt.parent().parent().Figures, function (figure, id) { if (figure.Type == "Text") { if (figure.Lines[0].trim() == "") { figure.set("IsTextBlank", true); isAllBlankLength++; } else { figure.set("IsTextBlank", false); } } }); if (isAllBlankLength > 1) { if (isAllBlankLength == dt.parent().parent().Figures.length || isAllBlankLength > 1) { isAllBalnk = true; $('.continueBtnForTextOrFont').attr('disabled', 'disabled'); } } if (isAllBalnk) { textfontvm.set("IsBlank", true); $('.continueBtnForTextOrFont').attr('disabled', 'disabled'); $.map(dt.parent().parent().Figures, function (figure, id) { if (figure.Type == "Text") { figure.set("IsTextBlank", false); } }); } else { textfontvm.set("IsBlank", false); } if (isAllBlankLength != 0) $('.continueBtnForTextOrFont').attr('disabled', 'disabled'); else if (isAllBlankLength == 0 && isAllBalnk == false) { $('.continueBtnForTextOrFont').removeAttr('disabled'); } }); }, refresh: function () { } }); binders.keyup = Binder.extend({ init: function (element, bindings, options) { Binder.fn.init.call(this, element, bindings, options); var textfontVm = si.get("sComm.vm.textOrFontSelectionModel"); var divElement = $(this.element); divElement.bind("keyup", function (e) { var data = e.currentTarget.kendoBindingTarget.source; var maxlen = textfontVm.get("maxlen"); var index = -1; var thisele = $(divElement).get(0); $.map(data.parent().parent().Figures, function (dt, i) { if (dt.Type == "Text") { index = i; } }); settextlimit(e, data, maxlen, thisele, index, textfontVm); }); }, refresh: function () { } }); function settextlimit(e, data, maxlen, thisele, index, vm) { var keyCode = [8, 13, 16, 35, 36, 37, 38, 39, 40, 46]; var parentIndex = data.parent().indexOf(data); if (keyCode.indexOf(e.keyCode) == -1) { var text = $(e.currentTarget).val(); var str1 = text.replace(/\s\s+/g, '1'); var count = str1.split(" ").length - 1; var s = text.trim().replace(/\s+/g, ' '); data.set("TextInput", s); var total; if (count > 0) { var len = text.length - count; total = len + (count * 2); } else { len = text.length; total = len; } if (len <= 14) { maxlen = 0; } if (maxlen == 0) { if (index == parentIndex) { vm.set("IsColorActionChanged", true); if (total >= 15) { maxlen = maxlen + 1; vm.set("maxlen", maxlen); $(e.currentTarget)[0].maxLength = len; thisele.setAttribute("maxlength", len); } else { thisele.setAttribute("maxlength", 15); } } else { $(e.currentTarget)[0].maxLength = 15; thisele.setAttribute("maxlength", 15); var otext = $(e.currentTarget).val(); data.set("TextInput", otext); } } } else { data.set("TextInput", $(e.currentTarget).val()); } } binders.focusouttext = Binder.extend({ init: function (element, bindings, options) { Binder.fn.init.call(this, element, bindings, options); var divElement = $(this.element); var productVm = si.get("sComm.vm.productEditModel"); divElement.bind("focusout", function (ev) { productVm.set("maxlen", 0); var dt = ev.currentTarget.kendoBindingTarget.source; var isAllBalnk = false; var isAllBlankLength = 0; if (dt.get("TextInput") != null) { $(ev.currentTarget).val(sComm.replaceHtml(dt.get("TextInput"))); dt.set("Lines[0]", sComm.replaceHtml($(ev.currentTarget).val())); } $.map(dt.parent().parent().Figures, function (figure, id) { if (figure.Type == "Text") { if (figure.Lines[0].trim() == "") { figure.set("IsTextBlank", true); isAllBlankLength++; } else { figure.set("IsTextBlank", false); } } }); if (isAllBlankLength > 1) { if (isAllBlankLength == dt.parent().parent().Figures.length || isAllBlankLength > 1) isAllBalnk = true; } if (isAllBalnk) { productVm.set("IsBlank", true); $.map(dt.parent().parent().Figures, function (figure, id) { if (figure.Type == "Text") { figure.set("IsTextBlank", false); } }); } else { productVm.set("IsBlank", false); } }); }, refresh: function () { } }); binders.keyuptext = Binder.extend({ init: function (element, bindings, options) { Binder.fn.init.call(this, element, bindings, options); var divElement = $(this.element); var productVm = si.get("sComm.vm.productEditModel"); divElement.bind("keyup", function (e) { var data = e.currentTarget.kendoBindingTarget.source; var maxlen = productVm.get("maxlen"); var index = -1; var keyCode = [8, 13, 16, 35, 36, 37, 38, 39, 40, 46]; var parentIndex = data.parent().indexOf(data); var thisele = $(divElement).get(0); $.map(data.parent(), function (dt, i) { if (dt.Type == "Text") { index = i; } }); settextlimit(e, data, maxlen, thisele, index, productVm); }); }, refresh: function () { } }); binders.templateTextChange = Binder.extend({ init: function (element, bindings, options) { //call the base constructor Binder.fn.init.call(this, element, bindings, options); var divElement = $(this.element); divElement.on('keyup', function (e) { var data = e.currentTarget.kendoBindingTarget.source; var figures = data.parent().parent().Figures; var isAnyBalnk = false; var hasChanged = false; var text = $(e.currentTarget).val(); data.set("Lines[0]", text); if (data.parent().parent().parent().parent().get("IsChecked")) { $.map(figures, function (figure, id) { if (figure.Lines[0].trim() == "") { isAnyBalnk = true; } if (figure.get("Lines[0]") != figure.get("OldText")) { hasChanged = true; } }); if (isAnyBalnk) { data.parent().parent().parent().parent().set("IsBlank", true); data.parent().parent().parent().parent().set("IsToUpdateTemplate", false); $('.confirmChoicesForFanwear').removeAttr('disabled'); } else { data.parent().parent().parent().parent().set("IsBlank", false); if (hasChanged) { data.parent().parent().parent().parent().set("IsToUpdateTemplate", true); $('.confirmChoicesForFanwear').attr('disabled', 'disabled'); } } } }); divElement.on('focusout', function (e) { var data = e.currentTarget.kendoBindingTarget.source; var figures = data.parent().parent().Figures; var isAnyBalnk = false; var hasChanged = false; var text = $(e.currentTarget).val(); data.set("Lines[0]", text); if (data.parent().parent().parent().parent().get("IsChecked")) { $.map(figures, function (figure, id) { if (figure.Lines[0].trim() == "") { isAnyBalnk = true; } if (figure.get("Lines[0]") != figure.get("OldText")) { hasChanged = true; } }); if (isAnyBalnk) { data.parent().parent().parent().parent().set("IsBlank", true); data.parent().parent().parent().parent().set("IsToUpdateTemplate", false); $('.confirmChoicesForFanwear').removeAttr('disabled'); } else { data.parent().parent().parent().parent().set("IsBlank", false); if (hasChanged) { data.parent().parent().parent().parent().set("IsToUpdateTemplate", true); $('.confirmChoicesForFanwear').attr('disabled', 'disabled'); } } } }); }, refresh: function (e) { } }); function findProductIndexFromArray(color, colorArray) { var idx = -1; $.map(colorArray, function (selectedcolor, ind) { if (selectedcolor.ProductId == color.ProductId) { idx = ind; return false; } }); return idx; } binders.multipleEditcheckbox = Binder.extend({ init: function (element, bindings, options) { Binder.fn.init.call(this, element, bindings, options); var productVm = si.get("sComm.vm.productMultipleEditModel"); var divElement = $(this.element); divElement.on('change', function (e) { var data = e.currentTarget.kendoBindingTarget.source; var selectedproducts = productVm.get("SelectedProducts"); var isChecked = divElement.prop("checked"); var idx = findProductIndexFromArray(data, selectedproducts); if (isChecked == false) { data.set("IsSelected", false); if (idx >= 0) selectedproducts.splice(idx, 1); } else { data.set("IsSelected", true); if (idx < 0) selectedproducts.push(data); } productVm.savevisiblity(); }); }, refresh: function () { } }); binders.checkIfAlreadyOwn = Binder.extend({ init: function (element, bindings, options) { Binder.fn.init.call(this, element, bindings, options); var divElement = $(this.element); divElement.on('click', function (e) { var that = si.get("sComm.vm.uniformListModel"); var data = e.currentTarget.kendoBindingTarget.source; var isChecked = divElement.prop("checked"); if (isChecked == false) { data.set("alreadyOwnItem", false); if (data.ProductInventoryId == "" || data.ProductInventoryId == null) { data.set("IfSizeNotSelected", true); } if (data.MinQuantity == 0) { data.set("IfQuantityNotSelected", true); } var id_name = "#" + data.UniformDetailId + "_" + data.PlayerId + "_name"; var id_number = "#" + data.UniformDetailId + "_" + data.PlayerId + "_number"; if (!$(id_name).val()) { data.set("IfJerseyNameIsBlank", true); } if (data.CollectNumber) { if (!$(id_number).val()) { data.set("IfJerseyNumberIsBlank", true); } } $($($($(divElement[0].parentElement)[0].parentElement)[0].parentElement)[0].parentElement).removeClass('disabled'); $($($($(divElement[0].parentElement)[0].parentElement)[0].parentElement)[0].parentElement).css('opacity', '1'); } else { data.set("alreadyOwnItem", true); data.set("IfSizeNotSelected", false); data.set("IfQuantityNotSelected", false); data.set("IfJerseyNameIsBlank", false); data.set("IfJerseyNumberIsBlank", false); $($($($(divElement[0].parentElement)[0].parentElement)[0].parentElement)[0].parentElement).addClass('disabled'); $($($($(divElement[0].parentElement)[0].parentElement)[0].parentElement)[0].parentElement).css('opacity', '0.5'); } that.set("hasAnyChange", true); sComGridView(".uniform-col"); }); }, refresh: function () { } }); binders.checkIfAlreadyOwnShoppingcart = Binder.extend({ init: function (element, bindings, options) { Binder.fn.init.call(this, element, bindings, options); var divElement = $(this.element); divElement.on('change', function (e) { var data = e.currentTarget.kendoBindingTarget.source; var that = uniformShoppingCartSummaryModel; var isChecked = divElement.prop("checked"); data.set("checkedIsrequiredToPlay", isChecked); var $trelement = $($($(divElement[0].parentElement)[0].parentElement)[0].parentElement); var $tdelement = $($(divElement[0].parentElement)[0].parentElement); var editbutton = $tdelement.find("a#jerseyeditid"); var smalleditbtn = $trelement.find("a.editsmallicon"); if (data.OldIsrequiredToPlay != data.checkedIsrequiredToPlay) { if (isChecked == false) { $trelement.find('td').css('opacity', '1'); that.EnableDisableDropdowns($trelement, true); smalleditbtn.removeClass("k-delete-button"); editbutton.removeAttr("disabled", "disabled"); that.checkforEditMode(); } else { $trelement.find('td').css('opacity', '0.5'); $trelement.find('td:last').css('opacity', '1'); smalleditbtn.addClass("k-delete-button"); that.EnableDisableDropdowns($trelement, false); editbutton.attr("disabled", "disabled"); data.set("IsUpdateVisible", true); data.set("IsOptionalDeleteVisible", false); that.setOtherVisibilityForOwn(data); that.checkforEditMode(); } } else { $trelement.find('td').css('opacity', '1'); smalleditbtn.removeClass("k-delete-button"); that.EnableDisableDropdowns($trelement, true); editbutton.removeAttr("disabled", "disabled"); data.set("IsUpdateVisible", false); data.set("IsOptionalDeleteVisible", true); that.checkforEditMode(); } }); }, refresh: function () { } }); binders.checkIfAlreadyOwnShoppingcartformerchandise = Binder.extend({ init: function (element, bindings, options) { Binder.fn.init.call(this, element, bindings, options); var divElement = $(this.element); divElement.on('change', function (e) { var data = e.currentTarget.kendoBindingTarget.source; var that = uniformMerchandiseModel; var isChecked = divElement.prop("checked"); data.set("checkedIsrequiredToPlay", isChecked); var $trelement = $($(divElement[0]).parents("[data-uid]")[0]); var $tdelement = $($(divElement[0].parentElement)[0].parentElement); var editbutton = $tdelement.find("a#jerseyeditid"); var smalleditbtn = $trelement.find("a.editsmallicon"); if (data.OldIsrequiredToPlay != data.checkedIsrequiredToPlay) { if (isChecked == false) { $trelement.find('td').css('opacity', '1'); that.EnableDisableDropdowns($trelement, true); smalleditbtn.removeClass("k-delete-button"); editbutton.removeAttr("disabled", "disabled"); } else { $trelement.find('td').css('opacity', '0.5'); $trelement.find('td:last').css('opacity', '1'); smalleditbtn.addClass("k-delete-button"); that.EnableDisableDropdowns($trelement, false); editbutton.attr("disabled", "disabled"); data.set("IsUpdateVisible", true); data.set("IsOptionalDeleteVisible", false); that.setOtherVisibilityForOwn(data); } } else { $trelement.find('td').css('opacity', '1'); smalleditbtn.removeClass("k-delete-button"); that.EnableDisableDropdowns($trelement, true); editbutton.removeAttr("disabled", "disabled"); data.set("IsUpdateVisible", false); data.set("IsOptionalDeleteVisible", true); } }); }, refresh: function () { } }); binders.checkIfAlreadyOwnForBypassedUniforms = Binder.extend({ init: function (element, bindings, options) { Binder.fn.init.call(this, element, bindings, options); var divElement = $(this.element); divElement.on('click', function (e) { var data = e.currentTarget.kendoBindingTarget.source; var isChecked = divElement.prop("checked"); if (isChecked == false) { data.set("alreadyOwnItem", false); if (data.ProductInventoryId == "" || data.ProductInventoryId == null) { data.set("IfSizeNotSelected", true); } if (data.MinQuantity == 0) { data.set("IfQuantityNotSelected", true); } var id_name = "#" + data.UniformDetailId + "_" + data.PlayerId + "_name"; var id_number = "#" + data.UniformDetailId + "_" + data.PlayerId + "_number"; if (!$(id_name).val()) { data.set("IfJerseyNameIsBlank", true); } if (data.CollectNumber) { if (!$(id_number).val()) { data.set("IfJerseyNumberIsBlank", true); } } $($($($(divElement[0].parentElement)[0].parentElement)[0].parentElement)[0].parentElement).removeClass('disabled'); $($($($(divElement[0].parentElement)[0].parentElement)[0].parentElement)[0].parentElement).css('opacity', '1'); } else { data.set("alreadyOwnItem", true); data.set("IfSizeNotSelected", false); data.set("IfQuantityNotSelected", false); data.set("IfJerseyNameIsBlank", false); data.set("IfJerseyNumberIsBlank", false); $($($($(divElement[0].parentElement)[0].parentElement)[0].parentElement)[0].parentElement).addClass('disabled'); $($($($(divElement[0].parentElement)[0].parentElement)[0].parentElement)[0].parentElement).css('opacity', '0.5'); } sComGridView(".uniform-col"); }); }, refresh: function () { } }); kendo.data.binders.widget.myCustomValue = kendo.data.Binder.extend({ init: function (element, bindings, options) { Binder.fn.init.call(this, element, bindings, options); var divElement = $(this.element); var inputElem = $(divElement[0].element); inputElem.on('keypressed', function (e) { if ($($($(inputElem[0].parentElement)[0].parentElement)[0].parentElement).attr('class') == 'disabled') { $(e.currentTarget).val(''); return false; } }); inputElem.on('keyup', function (e) { if ($($($(inputElem[0].parentElement)[0].parentElement)[0].parentElement).attr('class') == 'disabled') { $(e.currentTarget).val(''); return false; } var data = e.currentTarget.kendoBindingTarget.source; var isAnyBalnk = false; var isAnyWrongInput = false; var text = $(e.currentTarget).val(); if (!text) { isAnyBalnk = true; } if (!data.alreadyOwnItem) { if (isAnyBalnk) { data.set("IfJerseyNameIsBlank", true); } else { data.set("IfJerseyNameIsBlank", false); var re = "^[a-zA-Z0-9!@ \$%\*\[|\\]\+=_;\/\\\\\?:,()#&/'‘’.\s-]*$"; if (!text.match(re)) { isAnyWrongInput = true; } if (isAnyWrongInput) { data.set("IfJerseyNameIsWrongInput", true); } else { data.set("IfJerseyNameIsWrongInput", false); } } } //sComGridView(".uniform-col"); }); inputElem.on('focusout', function (e) { if ($($($(inputElem[0].parentElement)[0].parentElement)[0].parentElement).attr('class') == 'disabled') { $(e.currentTarget).val(''); return false; } var data = e.currentTarget.kendoBindingTarget.source; var isAnyBalnk = false; var isAnyWrongInput = false; var text = $(e.currentTarget).val(); if (!text) { isAnyBalnk = true; } if (!data.alreadyOwnItem) { if (isAnyBalnk) { data.set("IfJerseyNameIsBlank", true); } else { data.set("IfJerseyNameIsBlank", false); var re = "^[a-zA-Z0-9!@ \$%\*\[|\\]\+=_;\/\\\\\?:,()#&/'‘’.\s-]*$"; if (!text.match(re)) { isAnyWrongInput = true; } if (isAnyWrongInput) { data.set("IfJerseyNameIsWrongInput", true); } else { data.set("IfJerseyNameIsWrongInput", false); } } } sComGridView(".uniform-col"); }); }, refresh: function () { } }); kendo.data.binders.widget.JerseyNumberBind = kendo.data.Binder.extend({ init: function (element, bindings, options) { Binder.fn.init.call(this, element, bindings, options); var divElement = $(this.element); var inputElem = $(divElement[0].element); inputElem.on('keypressed', function (e) { if ($($($(inputElem[0].parentElement)[0].parentElement)[0].parentElement).attr('class') == 'disabled') { $(e.currentTarget).val(''); return false; } }); inputElem.on('keyup', function (e) { if ($($($(inputElem[0].parentElement)[0].parentElement)[0].parentElement).attr('class') == 'disabled') { $(e.currentTarget).val(''); return false; } var data = e.currentTarget.kendoBindingTarget.source; var isAnyBalnk = false; var text = $(e.currentTarget).val(); if (!text) { isAnyBalnk = true; } if (!data.alreadyOwnItem && data.CollectNumber) { if (isAnyBalnk) { data.set("IfJerseyNumberIsBlank", true); } else { data.set("IfJerseyNumberIsBlank", false); } } sComGridView(".uniform-col"); }); inputElem.on('focusout', function (e) { if ($($($(inputElem[0].parentElement)[0].parentElement)[0].parentElement).attr('class') == 'disabled') { $(e.currentTarget).val(''); return false; } var data = e.currentTarget.kendoBindingTarget.source; var isAnyBalnk = false; var text = $(e.currentTarget).val(); if (!text) { isAnyBalnk = true; } if (!data.alreadyOwnItem && data.CollectNumber) { if (isAnyBalnk) { data.set("IfJerseyNumberIsBlank", true); } else { data.set("IfJerseyNumberIsBlank", false); } } sComGridView(".uniform-col"); }); }, refresh: function () { } }); binders.IsCollectNumberChecked = kendo.data.Binder.extend({ init: function (element, bindings, options) { Binder.fn.init.call(this, element, bindings, options); var divElement = $(this.element); divElement.on('change', function (e) { var model = si.get("sComm.vm.enterItemDetailsStepViewModel"); if (model.isInEditMode == true) { model.set("hasAnyChangeInEditMode", true); } }); }, refresh: function () { } }); binders.IsCollectNameChecked = kendo.data.Binder.extend({ init: function (element, bindings, options) { Binder.fn.init.call(this, element, bindings, options); var divElement = $(this.element); divElement.on('change', function (e) { var isChecked = divElement.prop("checked"); var model = si.get("sComm.vm.enterItemDetailsStepViewModel"); if (isChecked) { model.uniformModel.set("ShowNameSelection", true); } else { model.uniformModel.set("ShowNameSelection", false); } if (model.isInEditMode == true) { model.set("hasAnyChangeInEditMode", true); } }); }, refresh: function () { } }); })(jQuery, window, document); ///#source 1 1 /Common/ViewDefinitions.js //#region ' fanwear ' sComm.vd.ManageFanWearLayout = "manageFanwearBase-template"; sComm.vd.FanwearPhotoView = "fanwearPhotoView-template"; sComm.vd.FanwearFilter = "filter-fanwear-template"; sComm.vd.FanwearShopyByCategory = "fanwear-shop-by-category-template"; sComm.vd.NoFanwearView = "no-fanwear-template"; sComm.vd.NoFanwearProductsView = "no-fanwear-products-template"; //#endregion //#region ' retail ' sComm.vd.ManageStoreFrontLayout = "manageStoreFrontBase-template"; sComm.vd.StoreFrontPhotoView = "storeFrontPhotoView-template"; sComm.vd.StoreFrontFilter = "filter-storefront-template"; sComm.vd.ShopyByCategory = "shop-by-category-template"; //#endregion //#region ' shopping cart ' sComm.vd.ManageShoppingCartLayout = "sCommShoppingCartBase-template"; sComm.vd.ShoppingCart = "sCommShoppingCart-template"; //#endregion //#region ' checkout steps ' sComm.vd.ManageCheckOutLayout = "checkOutBase-template"; sComm.vd.CheckOutContentBase = "checkOutContentBase-template"; sComm.vd.CheckOutContent = "checkOutContent-template"; sComm.vd.loginView = "loginView-template"; sComm.vd.shippingAddressView = "shippingAddressView-template"; sComm.vd.merchandiseView = "merchandiseView-template"; sComm.vd.paymentInfoView = "paymentInfoView-template"; sComm.vd.orderReviewView = "orderReviewView-template"; sComm.vd.PaymentConfirmationView = "paymentConfirmationView-template"; sComm.vd.OrderSummaryView = "orderSummaryContent-template"; //#endregion //#region ' fanwear wizard ' sComm.vd.PickClothing = "PickClothing-template"; sComm.vd.SelectTemplate = "SelectTemplate-template"; sComm.vd.ChooseArtWork = "ChooseArtWork-template"; sComm.vd.TextOrFonts = "TextOrFonts-template"; sComm.vd.DesignReview = "DesignReview-template"; sComm.vd.FinishSetUp = "FinishSetUp-template"; sComm.vd.Process = "Process-template"; //#endregion //#region ' store setup wizard ' sComm.vd.storeSetupProcess = "process-template"; sComm.vd.initialStep = "initialStep-template"; sComm.vd.activityTypeSelection = "activityTypeSelection-template"; sComm.vd.textAndColorSelection = "textAndColorSelection-template"; sComm.vd.storeSetupFanware = "fanware-template"; sComm.vd.artworkUploadPart1 = "artworkUploadPartOne-template"; sComm.vd.artworkUploadPart2 = "artworkUploadPartTwo-template"; sComm.vd.artworkUploadPart3 = "artworkUploadPartThree-template"; sComm.vd.funRaisingConfirmation = "fundRaisingConfirmation-template"; sComm.vd.storeSetupFinalStep = "finalStep-template"; //#endregion //#region ' store settings ' sComm.vd.storeSettingsHomePage = "storeSettingsHomePage-template"; sComm.vd.storeGeneralSettings = "storeGeneralSettings-template"; sComm.vd.storeAdvancedSettings = "storeAdvancedSettings-template"; sComm.vd.storeArtworkSettings = "storeArtworkSettings-template"; sComm.vd.storeFanwearSettings = "storeFanwearSettings-template"; sComm.vd.fanwearTemplateSettings = "fanwearTemplateSettings-template"; sComm.vd.artworkCadworxSettings = "artworkCadworxSettings-template"; sComm.vd.artworkPendingApprovalSettings = "artworkPendingApproval-template"; sComm.vd.fanwearTemplateVendorStyleSettings = "fanwearTemplateVendorStyleSettings-template"; //#endregion //#region ' multiple product edit ' sComm.vd.productMultipleHeader = "productMultipleHeader-template"; sComm.vd.productMultipleEdit = "productMultipleEdit-template"; //#endregion //#region ' uniform ' sComm.vd.ManageUniformLayout = "manageUniformBase-template"; sComm.vd.UniformList = "uniformList1-template"; //#endregion //#region ' order report ' sComm.vd.OrderReportList = "orderReportList-template"; sComm.vd.OrderListing = "orderListing-template"; //#endregion //#region ' product edit ' sComm.vd.productEdit = "productEdit-template"; sComm.vd.productView = "productView-template"; sComm.vd.productFeature = "productFeature-template"; sComm.vd.productHeader = "productHeader-template"; //#endregion //#region ' store activation ' sComm.vd.stepOne = "stepOne-template"; sComm.vd.stepTwo = "stepTwo-template"; sComm.vd.processActivation = "process-template"; //#endregion ///#source 1 1 /Common/RoutingDefinitions.js //#region ' retail ' sComm.rd.storeFrontList = "/storefront"; sComm.rd.storeFrontFilter = sComm.rd.storeFrontList + "/filter"; sComm.rd.shopyByCategory = sComm.rd.storeFrontList + "/shopByCategory"; sComm.rd.productEdit = sComm.rd.storeFrontList + "/Edit/:id"; sComm.rd.multipleProductEdit = sComm.rd.storeFrontList + "/multipledit/:ids"; //#endregion //#region ' checkout ' sComm.rd.checkOut = "/checkout"; sComm.rd.shippingAddress = "/shippingAddress"; sComm.rd.paymentInfo = "/paymentInfo"; sComm.rd.merchandiseOptions = "/merchandiseOptions"; sComm.rd.reviewOrder = "/reviewOrder"; sComm.rd.loginBack = "/login/back"; sComm.rd.shippingAddressBack = "/shippingAddress/back"; sComm.rd.merchandiseOptionsBack = "/merchandiseOptions/back"; sComm.rd.paymentInfoBack = "/paymentInfo/back"; sComm.rd.login = "/login"; sComm.rd.confirmationPayment = "/confirmationPayment/OrderId=:id"; //#endregion //#region ' shopping cart ' sComm.rd.shoppingCart = "/viewcart"; //#endregion //#region ' fanwear wizard ' sComm.rd.navigateToFanwearWizard = "/navigateToFanwearWizard"; sComm.rd.fanwearList = "/fanwear"; sComm.rd.fanwearFilter = sComm.rd.fanwearList + "/filterFanwear"; sComm.rd.fanwearShopyByCategory = sComm.rd.fanwearList + "/shopByCategoryFanwear"; sComm.rd.fanwearProductEdit = sComm.rd.fanwearList + "/edit/:id"; //#endregion //#region ' store setup wizard ' sComm.rd.wizard = "/wizard"; sComm.rd.initialstep = "/initialstep"; sComm.rd.activityTypeSelection = "/firststep"; sComm.rd.textAndColor = "/secondstep"; sComm.rd.fanwearstep = "/fanwearstep"; sComm.rd.fanwearstepBack = "/back/fanwearstep"; sComm.rd.artrworkUploadOne = "/thirdstepone"; sComm.rd.artrworkUploadTwo = "/thirdsteptwo"; sComm.rd.artrworkUploadThree = "/thirdstepthree"; sComm.rd.fundRaising = "/fourthstep"; sComm.rd.finalstep = "/finalstep"; //#endregion //#region ' settings ' sComm.rd.storesettings = "/storesettings"; sComm.rd.home = "/home"; sComm.rd.generalsettings = "/generalsettings"; sComm.rd.fanwearsettings = "/fanwearsettings"; sComm.rd.advancedsettings = "/advancedsettings"; sComm.rd.artworksettings = "/artworksettings"; sComm.rd.adminOrder = "/scomorders"; sComm.rd.adminPanel = "/adminpanel"; sComm.rd.orderReport = "/orderReport"; sComm.rd.fanwearTemplateVendorStyleSettings = "/fanwearTemplateVendorStyleSettings"; //#endregion //#region ' orders ' sComm.rd.orders = "/orders"; sComm.rd.myAccountOrders = "/myaccountorders"; //#endregion //#region ' end user store ' sComm.rd.endUserStorefront = "/endUserStorefront"; //#endregion //#region ' store activation ' sComm.rd.step1 = "/step1"; sComm.rd.step2 = "/step2"; //#endregion //#region ' uniform ' sComm.rd.importuniform = "/importuniform"; sComm.rd.uniformDetail = "/uniformdetailgridlist/:Uniformid/:ProgramId/:DivisionId/:PortalId/:Instancekey"; //#endregion sComm.rd.mainhome = "/mainhome"; sComm.rd.uniformManagement = "/uniformManagement"; sComm.rd.viewUniforms = "/viewUniforms"; sComm.rd.viewUnallocatedPlayers = "/viewUnallocatedPlayers"; ///#source 1 1 /Common/stt.js //Stats Translations. Type.registerNamespace('stt'); stt.currentLanguage = "en-US"; stt.get = function (key) { //return stt[stt.currentLanguage][key]; return stt[key]; } //stt["en-US"].OK = "OK"; stt.OK = "OK"; stt.errorTitle = "There is a problem"; stt.warningTitle = "Need your attention"; stt.successTitle = ":)"; stt.systemError = "Unfortunately, an error has occurred"; stt.generalError = "ERROR :"; //#region ' ShoppingCart ' stt.SC3000 = "Items settings saved successfully"; stt.SC2005 = "Cart is empty"; //#endregion //#region ' Shipping Address ' stt.SHP0001 = "Please fill up proper address for shipping"; //#endregion //#region ' ShoppingCart ' stt.SC1001 = "Item removed from cart successfully"; stt.SC1002 = "Item updated in cart successfully"; stt.SC1003 = "Please Select Quantity"; stt.SC1005 = "Your cart is empty"; stt.SC1004 = "Unfortunately, the item you are trying to purchase is now out of stock"; stt.SC1006 = "Your shopping cart has been updated successfully"; stt.SC1007 = "Please Enter valid Preferred Number"; stt.SC1008 = "Please update required details to continue"; stt.SC1009 = "Please fill all required information"; //#endregion //#region ' Settings ' stt.SET0000 = "Exclude all brand items?"; stt.SET2000 = "You are about to EXCLUDE all "; stt.SET2001 = " Brand(s) , items from showing up in your club store and spirit-wear lists.

If you wish only exclude a few items from this category, you can set up a restiction later on"; stt.SET2002 = "Delete Approved Artwork?"; //"You are about to delete approved artwork that has been modified
for print and cannot be recovered.

Are you sure you want to do this?"; stt.SET2003 = "You are about to delete an artwork that is being processed.

Are you sure you want to do this?"; stt.SET2004 = ""; stt.SET2005 = "Delete Artwork?"; stt.SET2006 = "Delete Custom Fanwear?"; stt.SET2007 = "You are about to delete Fanwear from your store. If you delete this it will be removed from your store and you won't be able to recover it.

Are you sure you want to do this?"; stt.SET2008 = "Successfully Updated"; stt.SET2009 = "Please Select Template"; stt.SET2010 = "Invalid Data"; stt.SET2011 = "Invalid CadWorx Template Id"; stt.SET2012 = "Invalid CadWorx Template JSON"; stt.SET2013 = "Invalid User"; stt.SET2014 = "Templates which are not updated: "; stt.SET2015 = "Delete Default Fanwear?"; stt.SET2016 = "Delete All Fanwear?"; stt.SET2017 = "Delete Fanwear?"; stt.SET2018 = "Style Code is required"; stt.SET2019 = "Template is required"; stt.SET2020 = "Record deleted successfully"; stt.SET2021 = "Unfortunately, an error has occurred while deleting this record"; stt.SET2022 = "Unfortunately, an error has occurred while updating this record"; stt.SET2023 = "Fanwear Template Vendor Style Id is missing"; stt.SET2024 = "Print Location is missing"; stt.SET2025 = "Image Height is missing"; stt.SET2026 = "Image Width is missing"; stt.SET2027 = "Artwork X Point is missing"; stt.SET2028 = "Artwork Y Point is missing"; stt.SET2029 = "Print Location Id is missing"; stt.SET2030 = "Record updated successfully"; stt.SET2031 = "Product not found"; stt.SET2032 = "Brand not found"; stt.SET2033 = "Product type not found"; stt.SET2034 = "Unfortunately, an error has occurred while creating this record"; stt.SET2035 = "Record added successfully"; stt.SET2036 = "Record for same template and vendor style is already exist"; //#endregion //#region ' CheckOut ' stt.CO1000 = "Email is required"; stt.CO1001 = "Password is required"; stt.CO1002 = "Invalid Email Address"; stt.CO1003 = "First Name is required"; stt.CO1004 = "Last Name is required"; stt.CO1005 = "Address is required"; stt.CO1006 = "City is required"; stt.CO1007 = "Country is required"; stt.CO1008 = "State is required"; stt.CO1009 = "ZIP Code is required"; stt.CO1010 = "Incorrect ZIP Code"; stt.CO1011 = "Card number is required"; stt.CO1012 = "Month is required"; stt.CO1013 = "Year is required"; stt.CO1014 = "Security code is required"; stt.CO1015 = "Only Visa/Master Card/American Express Credit Card Excepted"; stt.CO1016 = "Visa/Master Card Not Accepted"; stt.CO1017 = "American Express Card Not Accepted"; stt.CO1018 = "Invalid American Express Credit Card Number"; stt.CO1019 = "Invalid Visa/Master Card Credit Card Number"; stt.CO1020 = "Only Visa/Master Card Credit Card Excepted"; stt.CO1021 = "Card Id is not valid"; stt.PC0002 = "Cart Enpty"; stt.C0001 = "Shipping name is blank"; stt.C0002 = "Shipping address is blank"; stt.C0003 = "City is blank"; stt.C0004 = "Shipping state is blank"; stt.C0005 = "Shipping ZIP Code is blank"; stt.C0006 = "Shipping email is blank"; stt.C0007 = "Billing name is blank"; stt.C0008 = "Billing address is blank"; stt.C0009 = "Billing city is blank"; stt.C0010 = "Billing state is blank"; stt.C0011 = "Billing ZIP Code is blank"; stt.C0012 = "Billing email is blank"; stt.C0013 = "Card Number is not available"; stt.C0014 = "CVV number is missing"; stt.C0015 = "Expiry date or year is not valid"; stt.CO1022 = "Name is required"; //#endregion //#region ' Product edit ' stt.SCI0003 = "Product Id is not valid"; stt.SCI0004 = "Select Proper Size"; stt.SCI0006 = "Selected product is already in your cart"; stt.QTY = "Please Select Quantity"; //#endregion //#region 'product' stt.PRD0006 = "Product is not available"; stt.PRD1000 = "Product is not avaliable in stock"; stt.PRD0001 = "Product settings saved successfully"; //Eendregion SHP0001 = "Please fill up proper address for shipping"; stt.VRTX1001 = "Unfortunately, an error has occurred"; //#region 'store setup wizard' stt.SSW001 = "Your store is setting up in background. It will take a few minutes."; stt.SSW002 = "Please choose a different color"; stt.SSW003 = "A file with this name already exists. Please choose a different name."; stt.SSW005 = "Please select primary color first"; stt.SSW006 = "Wizard has been reset"; stt.SSW007 = "Changes has been approved"; stt.SSW008 = "Advanced Settings saved successfully"; stt.SSW009 = "Fanwear Settings saved successfully"; stt.SSW010 = "Product deleted"; stt.SSW011 = "General Settings saved successfully"; //Eendregion //#region 'order' stt.ORD0001 = "Not a valid user"; stt.ORD0001 = "You do not have access to view this tab within the portal"; stt.ORD002 = "Specifoed order not present"; stt.ORD0003 = "Your credit card is expired"; //endregion stt.CUT001 = "Your selected item was customized successfully"; //#region 'shopping cart item' stt.SCI0002 = "Quantity is missing"; stt.SCI0007 = "Product not Found"; stt.SCI0003 = "Not a valid user or guest"; stt.SCI0005 = "Can not delete this product as it is in use under shopping cart"; //endregion //#region 'fanwear wizard' stt.FW0001 = "Please select any product and color"; stt.FW0002 = "Failed to load product image"; stt.FW0003 = "Unfortunately, an error has occurred in generating fanwear products"; stt.FW0004 = "Fanwear Product is successfully created"; //endregion stt.ART0001 = "Same artwork is already exists for this portal. Please upload a different artwork"; stt.ART1005 = "There is a problem processing this artwork"; stt.ART1006 = "Artwork Name is Required"; stt.CDWRXID0002 = "Cadworx Clipart Id is not valid"; stt.IFE0001 = "File with this extension isnt allowed for upload"; stt.BRS0003 = "Brand id's isn't valid"; stt.SS0004 = "File name(s) can not be left blank"; stt.visa = "/Portals/_default/skins/bsb/images/icn-visa-45.png"; stt.mastercard = "/Portals/_default/skins/bsb/images/icn-master-card-45.png"; stt.amex = "/Portals/_default/skins/bsb/images/icn-american-express-card-45.png"; stt.noImage = "/images/spacer.gif"; stt.CAD001 = "Error retriving rendered image from server"; stt.ART0002 = "Successfully approved all the artwork(s)"; stt.ART0003 = "Can not process this artwork"; stt.SS0010 = "The file is already in your artwork library. If the artwork has been updated, please choose a different filename and upload again. Otherwise, no further action is required."; //#region 'uniform' stt.UNI001 = "Uniform is successfully deleted"; stt.UNI002 = "This Uniform is already configured with this Vendor Style"; stt.UNI003 = "No Product available for this Vendor style"; stt.UNI004 = "No inventory available for this product"; stt.UNI007 = "Uniform updated successfully"; stt.UNI008 = "Uniform saved successfully"; stt.UNI009 = "Price should not be blank for mentioned sizes"; stt.UNI010 = "Note: You have selected 'Fee Included In Registration'. This will make all the price for the sizes to 0"; stt.UNI011 = "Please add item in cart, Your cart is empty"; //#endregion